#include <iostream>
using namespace std;
int graph[1500][1500];
int subg[1500][1500];
int visit[1500];
void DFS(int a, int n)
{
    visit[a] = 1;
    for (int i = 1; i <= n; i++)
    {
        if (visit[i] == 0 && subg[a][i] == 1)
        {
            DFS(i, n);
        }
    }
}
int main()
{
    int n, m, k;
    int count;
    cin >> n >> m >> k;
    int i, j, h, a, b;
    bool flag;
    //城市坐标从1开始，初始化矩阵
    for (i = 0; i < m; i++)
    {
        cin >> a >> b;
        graph[a][b] = 1;
        graph[b][a] = 1;
    }
    for (i = 0; i < k; i++)
    {
        cin >> a;
        count = 0;
        flag = true;
        //在图中删除当前结点以及和他链接的边
        int row = 0, col;
        for (j = 1; j <= n; j++)
        {
            if (j != a)
            {
                row++;
                col = 1;
            }   
            else
                continue;
            for (h = 1; h <= n; h++)
            {
                if (h != a)
                    subg[row][col++] = graph[j][h];
            }
        }
        for (j = 1; j <= row; j++)
        {
            visit[j] = 0;
        }
        //找到图中的连通分量，除了被删除的结点，其余结点在查找完后的visit应该都为1
        while (flag)
        {
            //找到还没遍历的结点
            for (j = 1; j <= row; j++)
            {
                if (visit[j] == 0)
                    break;
            }
            if (j == row + 1)
                flag = false;
            else
            {
                flag = true;
                count++;
                DFS(j, row);
            }
        }
        cout << count - 1 << endl;
    }
    return 0;
}